<%@ page import="moudle.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="static java.awt.SystemColor.window" %><%--
  Created by IntelliJ IDEA.
  User: 34806
  Date: 2025/5/7
  Time: 10:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生信息列表展示</title>
    <style>
        .tab {
            font-size: 15px;
            border: yellow solid 2px;
            width: 600px;
            text-align: center;
            margin: 0 auto;
        }

        th, td, tr {
            border: lightgreen solid 2px;
        }

        body {
            background: ivory;
        }
    </style>
</head>
<body>
<%
    List<Student> date = (List<Student>) request.getAttribute("Date");
%>
<%--你依然保持在线！--%>
<a href='/javawebstudy2025_war_exploded/logout'>退出</a>
<table class="tab">
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>操作1</th>
        <th>操作2</th>
    </tr>
    <%
        for (int i = 0; i < date.size(); i++) {
    %>
    <tr>
        <td>
            <%=date.get(i).getId()%>
        </td>
        <td>
            <%=date.get(i).getName()%>
        </td>
        <td>
            <%=date.get(i).getSex()%>
        </td>
        <td>
            <%=date.get(i).getAge()%>
        </td>
        <td>
            <a href="/javawebstudy2025_war_exploded/Do?method=delDo&id=<%=date.get(i).getId()%>"
               onclick="if(confirm('确认删除吗？')) return true;return false;">删除</a>
        </td>
        <td>
            <a href="/javawebstudy2025_war_exploded/Do?method=getOneDo&id=<%=date.get(i).getId()%>">更新</a>
        </td>
    </tr>
    <%
        }
    %>
</table>
<button style='padding: 10px 20px;display: block; margin: 0 auto;'><a
        href="/javawebstudy2025_war_exploded/add.html">添加</a></button>
</body>
</html>
